<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2012.03.17.
   家居优惠活动列表显示($$)*/

!defined('Q_PATH') && exit;

class Index_C_Controller extends InitController{

	public function index(){
		// 载入相关缓存
		Core_Extend::loadCache('jiaju_eventhotcompany'.Core_Extend::getCityCache());// 热门品牌
		
		// 当前城市优惠活动
		$arrWhere=array();
		$arrWhere['A.jiajuevent_status']=1;
		$arrWhere['string_']=Core_Extend::getCitySql('A.');

		$nTotal=Model::F_('jiajuevent','@A')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,10,Jiaju_Extend::getEventList('{page}',false));
		$arrJiajuEvents=Model::F_('jiajuevent','@A')
			->setColumns('A.jiajuevent_id,A.jiajuevent_title,A.jiajuevent_thumb,A.jiajuevent_viewnum,A.jiajuevent_starttime,A.jiajuevent_endtime,A.jiajuevent_description')
			->where($arrWhere)
			->join(Q::C('DB_PREFIX').'jiajucompany AS F','F.jiajucompany_isfvip,F.jiajucompany_id,F.jiajucompany_domain,F.jiajucompany_fullname','A.jiajucompany_id=F.jiajucompany_id')
			->order('A.jiajuevent_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		Core_Extend::getSeo($this,array(
			'title'=>"#cityname#装修公司团购 - #cityname#装修公司优惠活动",
			'keywords'=>"#cityname#装修公司团购,#cityname#装修公司优惠活动",
			'description'=>"#cityname#装修公司团购网，为您提供最好的#cityname#装修公司团购服务，未消费，可随时退款！过期自动退款！#cityname#装修公司团购，尽在{$GLOBALS['_option_']['site_name']}【#cityname#装修公司团购网】",
		),true,true);

		$this->assign('arrJiajuEvents',$arrJiajuEvents);
		$this->assign('arrHotPingpaiJiajucompanys',$GLOBALS['_cache_']['jiaju_eventhotcompany'.Core_Extend::getCityCache()]);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display();
	}

}
